home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 5 / MacMania 5.toast / / Internet software / NewsWatcher / NW Source / Source / open.c < prev    next >
Text File  |  1997-01-09  |  1KB  |  43 lines

  1. /*----------------------------------------------------------------------------
  2.  
  3.     open.c
  4.  
  5.     This module handles the "Open" command. 
  6.     
  7.     Copyright © 1994-1997, Northwestern University.
  8.  
  9. ----------------------------------------------------------------------------*/
  10.  
  11. #include "glob.h"
  12. #include "open.h"
  13. #include "sfutil.h"
  14. #include "newsrc.h"
  15. #include "message.h"
  16. #include "fileutil.h"
  17.  
  18.  
  19.  
  20. /*----------------------------------------------------------------------------
  21.     DoOpen
  22.     
  23.     Handle the "Open" command.
  24.     
  25.     Exit:    function result = error code.
  26. ----------------------------------------------------------------------------*/
  27.  
  28. OSErr DoOpen (void)
  29. {
  30.     StandardFileReply reply;
  31.     WindowPtr wind;
  32.     
  33.     MyStandardGetFile(nil, kNumOpenTypeList, kOpenTypeList, &reply, 
  34.         gPrefs.savedUGLDefaultFolder ? gPrefs.savedUGLDefaultFolderAlias : nil);
  35.     if (!reply.sfGood) {
  36.         return userCanceledErr;
  37.     } else if (reply.sfType == kSavedUserGroupListFileType) {
  38.         return OpenUserGroupListFile(&reply.sfFile);
  39.     } else {
  40.         return OpenMessageFile(&reply.sfFile, &wind);
  41.     }
  42. }
  43.